import request from '@/utils/request'

// 顶部数据
const topDataShow = function (params = {}) {
  return request({
    url: '/zy-api/api/home/getSystemTotal',
    method: 'post',
    data: params
  })
}

// 年报许可水量监测率
const annualReportWaterData = function (ysyc) {
  return request({
    url: '/zy-api/api/home/getPermitMonitoringRate',
    method: 'post',
    data: { ysyc }
  })
}

// 年报许可水量监测率详情
const annualReportWaterDetailsData = function (params = {}) {
  return request({
    url: '/zy-api/api/home/getPermitMonitoringRateDetails',
    method: 'post',
    data: params,
    timeout: 3 * 60 * 1000,
  })
}

// 公报用水量监测率
const declaredWaterConsumptionData = function (ysyc) {
  return request({
    url: '/zy-api/api/home/getBulletinWater',
    method: 'post',
    data: { ysyc }
  })
}

// 公报用水量监测率详情
const declaredWaterConsumptionDetailsData = function (params = {}) {
  return request({
    url: '/zy-api/api/home/getBulletinWaterDetails',
    method: 'post',
    data: params
  })
}

// 非农取水同期对比
let waterIntakeContrastData = function (params = {}) {
  return request({
    url: '/zy-api/api/home/getNonfarmWater',
    method: 'post',
    data: params
  })
}

// 水资源管理工作检查数据
const manageWorkInspectionData = function (params = {}) {
  return request({
    url: '/zy-api/api/home/getAnexamination',
    method: 'post',
    data: params
  })
  /* return {
    status: 200,
    data:  [
      {
        "checkBody": "酉阳龙潭水厂",
        "endTime": "2020-05-14"
      }
    ]
  } */
}

// 设备运行状态 数据
const waterRunData = function (ysyc) {
  return request({
    url: '/zy-api/api/home/getEquipment',
    method: 'post',
    data: { ysyc }
  })
}


// 设备报送情况 数据
const deviceReportsData = function (ysyc) {
  return request({
    url: '/zy-api/api/home/getSubmitting',
    method: 'post',
    data: { ysyc }
  })
}

export {
  topDataShow,
  annualReportWaterData,
  annualReportWaterDetailsData,
  declaredWaterConsumptionData,
  declaredWaterConsumptionDetailsData,
  waterIntakeContrastData,
  manageWorkInspectionData,
  waterRunData,
  deviceReportsData
}